import Layout from '@/layout'
import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'login',
        component: () => import('@/views/login/index.vue')
    },
    {
        path: '/home',
        name: 'home',
        component: () => import('@/views/home/index.vue')
    },
    {
        path: '/unitManagement',
        name: 'unitManagement',
        component: Layout,
        redirect: '/unitManagement/unitInfo',
        meta: {
            title: '单位管理',
            icon: 'icon-unit'
        },
        children: [
            {
                path: 'unitInfo',
                name: 'unitInfo',
                component: () => import('@/views/unitManagement/unitInfo/detail.vue'),
                meta: {
                    title: '单位信息',
                    index: '1-1'
                }
            },
            {
                path: 'unitMembers',
                name: 'unitMembers',
                component: () => import('@/views/unitManagement/unitMembers/list.vue'),
                meta: {
                    title: '单位成员',
                    index: '1-2'
                }
            },
        ]
    },
    {
        path: '/down',
        name: 'down',
        component: Layout,
        redirect: '/down/downList',
        meta: {
            icon: 'icon-download1',
            title: '下载中心',
            index: '2'
        },
        children: [
            {
                path: 'downList',
                name: 'down',
                component: () => import('@/views/down/list.vue'),
                meta: {
                    title: '下载中心',
                    index: '2'
                }
            }
        ]
    },
]

const router = new VueRouter({
    mode: 'hash',
    routes,
})
export default router